<template>
  <div class="container" @click="handelGallaryClick">
    <div class="wrapper">
      <swiper :options="swiperOption">
        <!-- slides -->
        <swiper-slide v-for="(item,key) in bannerImgs" :key="key">
          <img class="gallary-img"
               :src=item>
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
  export default {
    name: "Gallary",
    props: {
      bannerImgs:Array
    },
    data() {
      return {
        swiperOption: {
          pagination: ".swiper-pagination",
          paginationType: 'fraction',
          observer:true,
          observeParents:true
        }
      }
    },
    methods:{
      handelGallaryClick(){
        this.$emit('gallaryclose')
      }
    }
  }
</script>

<style lang="stylus" scoped>
  .container {
    z-index 99
    flex-direction column
    display flex
    justify-content center
    position fixed
    left 0
    right 0
    top 0
    bottom 0
    background-color #000

    .wrapper {
      overflow hidden
      height 0
      width 100%
      padding-bottom 100%

      .gallary-img {
        width 100%
      }

      .swiper-pagination {
        color #ffffff
        position fixed
        bottom 1rem
      }
    }
  }

</style>
